<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/kaoqin.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
    <style>
        table{
            table-layout: fixed;
        }
        td{
            height: 60px;
            white-space: nowrap;/*控制单行显示*/
            overflow: hidden;/*超出隐藏*/
            text-overflow: ellipsis;/*隐藏的字符用省略号表示*/
        }
        .operate{color: #1781d0;}
    </style>
</block>
<block name="content" >
    <section class="layui-larry-box mian-page page-attendanceStatistics">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form method="get" id='form'>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <select name="type_id" class="layui-input search_input type_id" data-model='notice_manage' style="width:150px">
                                    <option value="">所有类型</option>
                                    <foreach name="notice_code" item="code">
                                        <option value="{$code.code_no}" {$type_id == $code['code_no'] ? 'selected' : ''}>{$code.code_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline">
                            <input type="hidden" name="p" value="1" />
                            <a class="layui-btn search_btn categoryBtn" data-ctrl="notify" style="margin-left:10px;"> 添加类型</a>
                            <a class="layui-btn search_btn search" data-url="{:U('documentManage')}" style="margin-left:10px;"> 查询</a>
                        </div>
                    </form>
                </blockquote>
                <div class="layui-inline" style="float:left;margin-top:15px;">
                    <a class="layui-btn search_btn delMore" data-url="{:U('delMore',array('type'=>'notify'))}" style="margin-left:10px;"> 批量删除</a>
                </div>
                <div class="layui-inline" style="float:right;margin-top:15px;">
                    <a class="layui-btn search_btn" href="{:U('saveNotice')}" style="margin-left:10px;">新建公告</a>
                </div>
                <p style="clear:both"></p>
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box tabRedefine layui-tab-brief">
                    <div class="layui-tab-item layui-field-box layui-show absence">
                        <table class="layui-table setTabBg out" lay-skin="line">
                            <thead>
                                <tr>
                                    <th width="3%"><input type="checkbox" name="all" value=""></th>
                                    <th width="6%">发布人</th>
                                    <th width="8%">类型</th>
                                    <th width='15%'>发布范围</th>
                                    <th width="20%">标题</th>
                                    <th width="15%">发布时间</th>
                                    <th width="10%">生效日期</th>
                                    <th width="10%">终止日期</th>
                                    <th width="8%">状态</th>
                                    <th width="15%">操作</th>
                                </tr>
                            </thead>
                            <tbody id="tb">
                            <notempty>
                                <foreach name='notify' item='data'>
                                    <tr>
                                        <td><input class="more" name="notify_id[]" type="checkbox" value="{$data.notify_id}"></td>
                                        <td>{$data.from_id|getChineseName}</td>
                                        <td>{$data.type_id|getNoticeTypeName}</td>
                                        <td align='left' style="width:10%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title='部门：{$data.to_id}<if condition="$data['priv_id'] neq ''">&nbsp;&nbsp;角色：{$data.priv_id}</if><if condition="$data['user_id'] neq ''">&nbsp;&nbsp;人员：{$data.user_id}</if>'>
                                    <font style="color:#1781d0;font-weight:bolder;">部门：</font>{$data.to_id}
                                    <if condition="$data['priv_id'] neq ''">
                                        <font style="color:#1781d0;font-weight:bolder;">角色：</font>{$data.priv_id}
                                    </if>
                                    <if condition="$data['user_id'] neq ''">
                                        <font style="color:#1781d0;font-weight:bolder;">人员：</font>{$data.user_id}
                                    </if>
                                    </td>
                                    <td align='left' title="{$data.subject}">
                                        <a href='{:U("Personal/readNotify",array("notify_id"=>$data["notify_id"],"type_id"=>$_GET["type_id"],"is_manage"=>"manage"))}' style="color:#1781d0;">
                                            {$data.subject}
                                        </a>
                                    </td>
                                    <td>{$data.send_time}</td>
                                    <td>{$data.begin_date}</td>
                                    <td>{$data.end_date}</td>
                                    <td>
                                    <if condition='$data["publish"] eq 2'>
                                        <font color='#1781d0'>待审批</font>
                                        <elseif condition='$data["publish"] eq 1' />
                                        <font color='#00AA00'>生效</font>
                                        <elseif condition='$data["publish"] eq 3' />
                                        <font color='#FF0000'>不通过</font><br>
                                        <a data-id={$data.notify_id} data-type="notify" class="pointer read_opinion" style="color:#1781d0;">审批意见</a>
                                        <elseif condition='$data["publish"] eq 4' />
                                        <font color='#FF0000'>终止</font>
                                    </if>
                                    </td>
                                    <td>
                                        <!--<a class="operate">查阅情况</a>-->
                                    <if condition='$data["publish"] neq 2'>
                                        <a class="pointer operate statusNotice" data-url="{:U('noticeManage',array('notify_id'=>$data['notify_id'],'type_id'=>$type_id))}" >{$data["publish"] == 1?'终止':'生效'}</a>
                                    </if>
                                    <a class="pointer operate editNotice" href="{:U('saveNotice',array('notify_id'=>$data['notify_id'],'type_id'=>$type_id))}">修改</a>
                                    <a class="pointer operate delData" data-url='{:U("delNotice",array("notify_id"=>$data["notify_id"]))}'>删除</a>
                                    </td>
                                    <tr>
                                </foreach>
                            </notempty>
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-block">共{$count}条数据</div>
                    <div class="larry-table-page clearfix">
                        <div id="page" class="page">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/erp.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(initAddCate());
        $(initErp());
    </script>
</block>